#DES new decisions#

DES_desert_gambit_category = {

	DES_baghdad_rail_mission = {
		icon = GFX_decision_generic_flags
		allowed = { always = no }
		available = {
			has_global_flag = completed_berlin_baghdad_renovate_rail
		}
		selectable_mission = yes
		is_good = no
		days_mission_timeout = 365
		ai_will_do = {
			base = 100
		}
		complete_effect = { ###LETS GO
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_baghdad_rail_mission"
			diplomatic_relation = {
				country = OTT
				relation = non_aggression_pact
			}
			diplomatic_relation = {
				country = OTT
				relation = docking_rights
			}
			news_event = DESnews.1
			set_global_flag = ger_ott_baghdad_rail_success
		}
		timeout_effect = { ###Bad End
			log = "[GetDateText]: [Root.GetName]: Decision timeout DES_ashgabat_accord_mission"
			add_political_power = -25
		}
	}

	DES_pick_turkey = {
		icon = GFX_decision_generic_agreement
		allowed = { tag = GER }
		available = {
			has_global_flag = completed_berlin_baghdad_renovate_rail
		}
		cost = 5

		fire_only_once = yes
		ai_will_do = {
			base = 100
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_pick_turkey target: [From.GetName]"
			activate_targeted_decision = { target = AZR decision = GER_AZR_align_azerbaijan }
			activate_targeted_decision = { target = OTT decision = GER_OTT_settling_old_disputes }
			activate_targeted_decision = { target = OTT decision = DES_GER_generic_mission }
			activate_targeted_decision = { target = 49 decision = DES_ankara_1 }
			activate_targeted_decision = { target = 49 decision = DES_ankara_2 }
			activate_targeted_decision = { target = 49 decision = DES_ankara_3 }
			activate_targeted_decision = { target = 349 decision = DES_kirkuk_oil } 
			activate_targeted_decision = { target = 183 decision = DES_cyprus_base }
		}
	}

	DES_GER_generic_mission = {
		icon = GFX_decision_generic_army_support
		allowed = { always = no }
		available = {
		}
		custom_cost_trigger = {
			command_power > 25
		}
		custom_cost_text = CP_25
		fire_only_once = yes
		ai_will_do = {
			base = 10
			modifier = {
				add = 20
				command_power > 75
			}
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_GER_generic_mission target: [From.GetName]"
			hidden_effect = {
				add_command_power = -25
			}
			FROM = {
				country_event = DES.4
			}
			custom_effect_tooltip = if_they_accept_tt
			effect_tooltip = {
				army_experience = 30
				FROM = {
					add_ideas = GER_DES_generic_military_mission
				}
			}
		}
	}

	DES_combined_armoured_train_research = {
		icon = GFX_decision_train
		allowed = { always = no }
		custom_cost_trigger = {
			command_power > 25
		}
		custom_cost_text = CP_25
		days_remove = 80
		fire_only_once = yes
		ai_will_do = {
			base = 10
			modifier = {
				add = 20
				command_power > 75
			}
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_combined_armoured_train_research target: [From.GetName]"
			hidden_effect = {
				add_command_power = -25
			}
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove DES_combined_armoured_train_research target: [From.GetName]"
			if = {
				limit = { NOT = { has_tech = armored_train } }
				set_technology = { armored_train = 1 }
			}
			OTT = {
				if = {
					limit = { NOT = { has_tech = armored_train } }
					set_technology = { armored_train = 1 }
				}
			}
			custom_effect_tooltip = DES_armoured_train_reduce_unrest_tt
			set_global_flag = DES_armoured_train_ready
		}
	}


	DES_ankara_1 = {
		icon = GFX_decision_cement_mixer
		allowed = { always = no }
		visible = {
			FROM = { is_fully_controlled_by = OTT }
		}
		cancel_if_not_visible = yes
		available = {
			FROM = { is_fully_controlled_by = OTT }
			num_of_civilian_factories_available_for_projects > 2
		}
		highlight_states = { highlight_state_targets = { state = 49 } } #Ankara
		cost = 25

		state_target = yes
		days_remove = 120
		fire_only_once = yes
		modifier = { civilian_factory_use = 3 }
		ai_will_do = {
			base = 0
			modifier = {
				add = 10
				has_political_power > 75
			}
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_ankara_1 target: [From.GetName]"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove DES_ankara_1 target: [From.GetName]"
			49 = {
				add_building_construction = { type = infrastructure level = 2 }
				increase_state_category_by_two_levels = yes
				set_global_flag = ankara_1_completed
				hidden_effect = { add_manpower = 300000 }
			}
		}
	}

	DES_ankara_2 = {
		icon = GFX_decision_generic_construction
		allowed = { always = no }
		visible = {
			FROM = { is_fully_controlled_by = OTT }
		}
		cancel_if_not_visible = yes
		available = {
			FROM = { is_fully_controlled_by = OTT }
			num_of_civilian_factories_available_for_projects > 3
			has_global_flag = ankara_1_completed
		}
		highlight_states = { highlight_state_targets = { state = 49 } } #Ankara
		cost = 25

		state_target = yes
		days_remove = 120
		fire_only_once = yes
		modifier = { civilian_factory_use = 4 }
		ai_will_do = {
			base = 0
			modifier = {
				add = 10
				has_political_power > 75
			}
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_ankara_2 target: [From.GetName]"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove DES_ankara_2 target: [From.GetName]"
			49 = {
				add_extra_state_shared_building_slots = 3
				add_building_construction = { type = industrial_complex level = 3 }
				increase_state_category_by_two_levels = yes
				set_global_flag = ankara_2_completed
				ott_decrease_revolt_risk = yes
				add_resource = {
					type = steel
					amount = 16
				}
				hidden_effect = { add_manpower = 100000 }
			}
			OTT = {
				add_tech_bonus = {
					name = DES_ankara_2
					bonus = 0.5
					uses = 1
					category = construction_tech
				}
			}
		}
	}

	DES_ankara_3 = {
		icon = GFX_decision_generic_industry
		allowed = { always = no }
		visible = {
			FROM = { is_fully_controlled_by = OTT }
		}
		cancel_if_not_visible = yes
		available = {
			FROM = { is_fully_controlled_by = OTT }
			num_of_civilian_factories_available_for_projects > 4
			has_global_flag = ankara_2_completed
		}
		highlight_states = { highlight_state_targets = { state = 49 } } #Ankara
		cost = 25

		state_target = yes
		days_remove = 120
		fire_only_once = yes
		modifier = { civilian_factory_use = 4 }
		ai_will_do = {
			base = 0
			modifier = {
				add = 10
				has_political_power > 75
			}
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_ankara_3 target: [From.GetName]"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove DES_ankara_3 target: [From.GetName]"
			49 = {
				add_extra_state_shared_building_slots = 3
				add_building_construction = { type = arms_factory level = 3 }
				increase_state_category_by_two_levels = yes
				set_global_flag = ankara_3_completed
				ott_decrease_revolt_risk = yes
				if = {
					limit = { not_have_facility = yes }
					add_building_construction = {
						type = land_facility
						level = 1
						province = 11747 #Ankara
						instant_build = yes
					}
				}
				hidden_effect = { add_manpower = 100000 }
			}
		}
	}

	DES_kirkuk_oil = {
		icon = GFX_decision_oil
		allowed = { always = no }
		visible = {
			FROM = { is_fully_controlled_by = OTT }
		}
		cancel_if_not_visible = yes
		available = {
			FROM = { is_fully_controlled_by = OTT }
			num_of_civilian_factories_available_for_projects > 2
		}
		highlight_states = { highlight_state_targets = { state = 349 } } #kirkuk
		cost = 40

		state_target = yes
		days_remove = 160
		fire_only_once = yes
		modifier = { civilian_factory_use = 2 }
		ai_will_do = {
			base = 0
			modifier = {
				add = 5
				has_political_power > 100
			}
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_kirkuk_oil target: [From.GetName]"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove DES_kirkuk_oil target: [From.GetName]"
			349 = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = { type = synthetic_refinery level = 1 }
				increase_state_category_by_one_level = yes
				ott_decrease_revolt_risk = yes
				add_resource = {
					type = oil
					amount = 15
				}
				add_building_construction = {
					type = bunker
					level = 3
					instant_build = yes
					province = {
						all_provinces = yes
					}
				}
			}
		}
	}

	DES_cyprus_base = {
		icon = GFX_decision_generic_naval_base
		allowed = { always = no }
		visible = {
			FROM = { is_fully_controlled_by = OTT }
		}
		cancel_if_not_visible = yes
		available = {
			FROM = { is_fully_controlled_by = OTT }
			num_of_civilian_factories_available_for_projects > 2
		}
		highlight_states = { highlight_state_targets = { state = 183 } } #cyprus
		cost = 30

		state_target = yes
		days_remove = 120
		fire_only_once = yes
		modifier = { civilian_factory_use = 1 }
		ai_will_do = {
			base = 0
			modifier = {
				add = 5
				has_political_power > 100
			}
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_cyprus_base target: [From.GetName]"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove DES_cyprus_base target: [From.GetName]"
			183 = {
				add_extra_state_shared_building_slots = 1
				add_building_construction = { type = dockyard level = 1 }
				increase_state_category_by_one_level = yes
				ott_decrease_revolt_risk = yes
				add_building_construction = {
					type = naval_base
					level = 3
					province = 11984
					instant_build = yes
				}
			}
		}
	}


	DES_berlin_baghdad_renovate_railroad = {
		icon = GFX_decision_train
		allowed = { always = no }
		visible = {
			344 = { is_controlled_by = OTT }
			677 = { is_controlled_by = OTT }
			350 = { is_controlled_by = OTT }
			676 = { is_controlled_by = OTT }
			291 = { is_controlled_by = OTT }
		}
		cancel_if_not_visible = yes
		available = {
			344 = { is_controlled_by = OTT }
			677 = { is_controlled_by = OTT }
			350 = { is_controlled_by = OTT }
			676 = { is_controlled_by = OTT }
			291 = { is_controlled_by = OTT }
			812 = { is_controlled_by = OTT }
			num_of_civilian_factories_available_for_projects > 3
		}
		highlight_states = {
			highlight_state_targets = {
				state = 344
				state = 677
				state = 350
				state = 676
				state = 291
				state = 812
			}
		}
		cost = 50

		state_target = yes
		days_remove = 180
		fire_only_once = yes
		modifier = { civilian_factory_use = 4 }
		ai_will_do = {
			base = 2000
		}
		complete_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision complete DES_berlin_baghdad_railroad target: [From.GetName]"
		}
		remove_effect = {
			log = "[GetDateText]: [Root.GetName]: Decision remove DES_berlin_baghdad_railroad target: [From.GetName]"
			set_global_flag = completed_berlin_baghdad_renovate_rail
			custom_effect_tooltip = DES_armoured_train_reduce_unrest_tt
			build_railway = {
    				level = 2
    				start_province = 3889 #adana
    				target_province = 2089 #ashgabat
			}
			350 = {
				add_building_construction = { type = infrastructure level = 1 }
				increase_state_category_by_one_level = yes
				if = {
					limit = { has_global_flag = DES_armoured_train_ready }
					ott_decrease_revolt_risk = yes
				}
			}
			676 = {
				add_building_construction = { type = infrastructure level = 1 }
				increase_state_category_by_one_level = yes
				if = {
					limit = { has_global_flag = DES_armoured_train_ready }
					ott_decrease_revolt_risk = yes
				}
			}
			291 = {
				increase_state_category_by_one_level = yes
				if = {
					limit = { has_global_flag = DES_armoured_train_ready }
					ott_decrease_revolt_risk = yes
				}
			}
			812 = {
				add_building_construction = { type = infrastructure level = 1 }
				increase_state_category_by_one_level = yes
				if = {
					limit = { has_global_flag = DES_armoured_train_ready }
					ott_decrease_revolt_risk = yes
				}
			}
			OTT = { 
				add_equipment_to_stockpile = {
					type = train_equipment_3
					amount = 30
					producer = GER
				}
			}
		}
	}

}